package com.aier.bean.foreign;

import com.aier.bean.common.FieldDescription;
import com.aier.utils.LocalDateConverter;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDate;

/***
 * 外贸基础数据
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("foreign_base")
@ContentRowHeight(25)
@ColumnWidth(20)
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
public class ForeignBase {
    @TableField("fba_code")
    @ExcelProperty(value = "FBA码",index = 0)
    @FieldDescription("FBA码")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    public String fbaCode;


    @ExcelProperty(value = "跟踪号",index = 1)
    @FieldDescription("跟踪号")
    @TableField("tracking_number")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public String trackingNumber;

    @ExcelProperty(value = "仓库编码",index = 2)
    @FieldDescription("仓库编码")
    @TableField("warehouse_code")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public String warehouseCode;

    @ExcelProperty(value = "ASIN",index = 3)
    @FieldDescription("ASIN")
    @TableField("asin")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public String asin;

    @ExcelProperty(value = "产品sku",index = 4)
    @FieldDescription("产品sku")
    @TableField("sku")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(20)
    public String sku;

    @ExcelProperty(value = "图片",index = 5)
    @FieldDescription("图片")
    @TableField("picture")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public String picture;

    @ExcelProperty(value = "箱数",index = 6)
    @FieldDescription("箱数")
    @TableField("box_num")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal boxNum;

    @ExcelProperty(value = "每箱数量",index = 7)
    @FieldDescription("每箱数量")
    @TableField("per_box_qty")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal perBoxQty;

    @ExcelProperty(value = "外箱长度(cm)",index = 8)
    @FieldDescription("外箱长度(cm)")
    @TableField("box_length")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal boxLength;

    @ExcelProperty(value = "外箱宽度(cm)",index = 9)
    @FieldDescription("外箱宽度(cm)")
    @TableField("box_width")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal boxWidth;

    @ExcelProperty(value = "外箱高度(cm)",index = 10)
    @FieldDescription("外箱高度(cm)")
    @TableField("box_height")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal boxHeight;

    @ExcelProperty(value = "整箱重量(KG)",index = 11)
    @FieldDescription("整箱重量(KG)")
    @TableField("weight")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public BigDecimal weight;

    @ExcelProperty(value = "建单日期",converter = LocalDateConverter.class,index = 12)
    @FieldDescription("建单日期")
    @DateTimeFormat("yyyy-MM-dd")
    @TableField("build_date")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public LocalDate buildDate;

    @ExcelProperty(value = "员工id",index = 13)
    @FieldDescription("员工id")
    @TableField("staff_id")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public String staffId;

    @ExcelProperty(value = "员工姓名",index = 14)
    @FieldDescription("员工姓名")
    @TableField("staff_name")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(15)
    public String staffName;

    /** 平台 P01-亚马逊**/
    @ExcelProperty(value = "平台",index = 15)
    @FieldDescription("平台")
    @TableField("platforms")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public String platforms;

    /** 国家 C01-美国，C02-加拿大 **/
    @ExcelProperty(value = "国家",index = 16)
    @FieldDescription("国家")
    @TableField("country")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public String country;


    @TableField("forwarder_id")
    @FieldDescription("货代")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    @ExcelIgnore
    public Integer forwarderId;

    @TableField("self_taxed")
    @FieldDescription("是否自税")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    @ExcelIgnore
    public String selfTaxed;

    @TableField("is_shipment")
    @FieldDescription("是否发货")
    @ExcelProperty(value = "是否发货")
    @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
    @ColumnWidth(10)
    public String isShipment;
}
